import socket, struct


def SendData(s, str):
    n = len(str)
    s.send(struct.pack(f'i{n}s', n, str.encode('cp866')))


def ReceiveData(s):
    n = struct.unpack('i', s.recv(4))[0]
    return struct.unpack(f'{n}s', s.recv(n))[0].decode('cp866')

HOST = '192.168.37.128'
PORT = 12345
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
    s.connect((HOST, PORT))
    while True:
        SendData(s, input())
        print(ReceiveData(s))
